$(function() {
	//初始化datatable
	$("#table").XRDataTable({
		ajaxUrl: "Admin/StatisticsAttendScore/getDatas",
		paramFunc: paramFunc,		
		hasCheckbox: false 
	});
    laydate.render({
        elem: '#start_time', //指定元素
        trigger: 'click'
    });
    laydate.render({
        elem: '#end_time', //指定元素
        trigger: 'click'
    });

	// exportEvent(); 
}); 

var paramFunc = function() { 
	var data = getFormJson();
	return data; 
};

function Export(){		
	var data = getFormJson();
	// window.open($("#url").val()+'Admin/StatisticsFeedBack/StatisticsOther/-1/'+$('#start_time').val()+'/'+$('#end_time').val()+'/true');
	var msg = "请确认是否导出?";
    swal({
        title: "请确认",
        text: msg,
        type: "warning",
        showCancelButton: true,
        closeOnConfirm: true,
        confirmButtonText: "确定",
        cancelButtonText: '取消',
        confirmButtonColor: "#ec6c62"
    }, function(isConfirm) {
        if(isConfirm) {
            var load_alert=loadAlert('数据导出中，请稍后...');
            $.ajax({
                type: "post",
                url: "Admin/StatisticsAttendScore/getDatas/1/true",
                data:data,
                async: true,
                dataType:'json',
                success: function(data) {
                    closeAlert(load_alert);
                    if(data.status) {
                        location.href=getRootPath()+'/'+data.v;
                    } else {
                        window.parent.topMessagePrompt('error',ret.msg);
                    }
                }
            });
        }
    });
}